package com.iotp.service.time_config;

import com.iotp.dao.time_config.TimeConfigMapper;
import com.iotp.entity.time_config.TimeConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("timeConfigService")
public class TimeConfigServiceImpl implements TimeConfigService {
    @Autowired
    private TimeConfigMapper timeConfigMapper;

    @Override
    public Long add(TimeConfig timeConfig) {
        this.timeConfigMapper.insert(timeConfig);
        return timeConfig.getId();
    }

    @Override
    public void update(TimeConfig timeConfig) {
        this.timeConfigMapper.updateByPrimaryKeySelective(timeConfig);
    }

    @Override
    public void delete(Long id) {
        this.timeConfigMapper.deleteByPrimaryKey(id);
    }

    @Override
    public TimeConfig queryById(Long id) {
        return this.timeConfigMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<TimeConfig> queryByList(TimeConfig timeConfig) {
        return this.timeConfigMapper.selectByCondition(timeConfig);
    }
}
